#include<bits/stdc++.h>
#define sd(n) scanf("%d",&n) 
#define sld(n) scanf("%lld",&n)
#define pd(n) printf("%d", (n))
#define pld(n) printf("%lld", n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fi first
#define se second
const int N = 1e5;
#define INF 0x7fffffff
typedef long long int ll;
using namespace std;
typedef pair<int, int> PII;
//----------------------------------------------------------------------------//
int n, k;
PII a[N + 10];//fi h,se w
void solve()
{
	int res = -1;
	sd(n); sd(k);
	for (int i = 0; i < n; i++)
	{
		sd(a[i].fi);
		sd(a[i].se);
		res = max(max(a[i].fi, a[i].se), res);
	}
	while (true)
	{
		int count = 0;
		for (int i = 0; i < n; i++) count += ((a[i].fi / res) * (a[i].se /res));

		if (count >= k) break;
		else res--;
	}
	pd(res);
	puts("");

}

int main()
{
	int T = 1;
	//sd(T);
	while (T--)
	{
		solve();
	}
	return 0;
}